﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace QLVT
{
    class HoaDonDAL
    {
        public HoaDonDAL()
        {

        }
        public void ThemHoaDon(string hoadon, string mahang, string diengiai,
                          double soluong, double dongia, double trigia, double khuyenmai)
        {
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = "Data Source=(local);Initial Catalog=qlvt; User Id=sa; Password=sa";
            conn.Open();
            SqlCommand cmd = new SqlCommand("insert into hoadon values ('"+ hoadon +"','"+ mahang +"',"+ soluong.ToString() +","+ dongia.ToString() +","+ trigia.ToString() +","+ khuyenmai.ToString() +",'"+ diengiai +"' )", conn);
            cmd.ExecuteNonQuery(); 
        }
    }
}
